package com.kavian.probability;

import com.kavian.probability.collect.dao.CollectDao;


/**
 * 测试
 * @author Administrator
 *
 */
public class Test{
	
	public static void main(String[] args) {
	
		//排序
//		double a = ProbabilityUtil.arrangement(36, 7);
//		System.out.println(a);
		
		
		//组合
//		double c = ProbabilityUtil.combination(36, 7);
//		System.out.println(c);
		
		CollectDao collect = new CollectDao();
		int total = collect.findTotal();
		
		String num = "00";
		//红球
		for (int i = 1; i <= 33; i++) {
			if(i<10){
				num = "0"+i;
			}else{
				num = i+"";
			}
			
			int redTotal = collect.findRedBallCount(num);
			
			double p = (double)redTotal/total;
			
			System.out.println("红"+num+":"+ p);
		}
		
		//蓝球
		for (int i = 1; i < 16; i++) {
			if(i<10){
				num = "0"+i;
			}else{
				num = i+"";
			}
			
			int redTotal = collect.findBlueBallCount(num);
			
			double p = (double)redTotal/total;
			
			System.out.println("蓝"+num+":"+ p);
		}
		
//		List<ColorBall> color = collect.searchCollect();
//		System.out.println(total);
	}
}